package com.hyperf.event.client.exception;

import lombok.Getter;
import lombok.Setter;

/**
 * 异常类
 *
 * @author lizhaoyang
 * @date 2020/11/30
 */
@Getter
@Setter
public class EventException extends RuntimeException {

    private static final long serialVersionUID = -1851967442680844269L;

    private int errorCode;

    private String errorMessage;

    public EventException() {
        super();
    }

    public EventException(String errorMessage) {
        super(errorMessage);
        this.errorMessage = errorMessage;
    }

    public EventException(int errorCode, String errorMessage) {
        this(errorMessage);
        this.errorCode = errorCode;
    }

    @Override
    public String toString() {
        return this.errorCode + ":" + this.errorMessage;
    }
}
